From: Florian Müllner Date: Fri, 7 Feb 2025 14:54:15 +0000 (+0100) Subject: appDisplay: Filter apps in default folder X-Git-Tag: archive/raspbian/50.5-1+rpi1~1^2~153^2^2~45 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=852a0a89ac536b7937c9013166216531cd45b6d3;p=gnome-shell.git appDisplay: Filter apps in default folder We currently create the default folder with the corresponding app list, regardless of whether the apps are actually part of the default install or not. This matters when a user explicitly install such an app later, as it will be hidden away in the folder rather than appended to the app grid as expected. To avoid that, only add currently-installed apps to the folder when creating it. Part-of: --- diff --git a/js/ui/appDisplay.js b/js/ui/appDisplay.js index 9801b7134..b08d9af5d 100644 --- a/js/ui/appDisplay.js +++ b/js/ui/appDisplay.js @@ -1418,12 +1418,16 @@ class AppDisplay extends BaseAppView { if (this._folderSettings.get_strv('folder-children').length > 0) return; + const appSys = Shell.AppSystem.get_default(); const folders = Object.keys(DEFAULT_FOLDERS); this._folderSettings.set_strv('folder-children', folders); const {path} = this._folderSettings; for (const folder of folders) { const {name, categories, apps} = DEFAULT_FOLDERS[folder]; + const filteredApps = apps + ? apps.filter(id => appSys.lookup_app(id) != null) + : []; const child = new Gio.Settings({ schema_id: 'org.gnome.desktop.app-folders.folder', path: `${path}folders/${folder}/`, @@ -1432,8 +1436,8 @@ class AppDisplay extends BaseAppView { child.set_boolean('translate', true); if (categories) child.set_strv('categories', categories); - if (apps) - child.set_strv('apps', apps); + if (filteredApps.length > 0) + child.set_strv('apps', filteredApps); } }